﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class CJChemicals_MyAccount : System.Web.UI.Page
{

    #region MEMBER VARIABLES

    private clsCommonFunctions clsCommonFunctions; 

    #endregion

    #region EVENTS

    protected void Page_Load(object sender, EventArgs e)
    {
        //string Test = TextBox1.Text;
        if (!IsPostBack)
        {
            clsCommonFunctions = new clsCommonFunctions();
            //Check to see if we need to log in user
            //if (Request.QueryString["FrontLog"] == "True")
            //{
            //    //encrypt password before passing it through the query string 
            //    string Password = clsCommonFunctions.GetMd5Sum(TextBoxPassword.Text);
            //    //Redirect to Login Page
            //    Response.Redirect("frmAdminLogin.aspx?FrontLogin=True&Username=" + TextBoxUsername.Text + "&Password=" + Password + "");
            //}
        }

        //If there was an error with credentials then show error 
        if (Request.QueryString["Error"] == "Credentials")
        {
            //Display the error
            ErrorLable.Text = "<b class=\"errorMsg\">Invalid login credentials! Please try again.</b>";
        }

        if (Session["clsClient"] != null)
        {
            //Display the error
            ErrorLable.Text = "<b class=\"errorMsg\">Logged In Successfully.</b>";
        }

    }

    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        //encrypt password before passing it through the query string 
        string Password = clsCommonFunctions.GetMd5Sum(TextBoxPassword.Text);
        //Redirect to Login Page
        Response.Redirect("frmAdminLogin.aspx?FrontLogin=True&Username=" + TextBoxUsername.Text + "&Password=" + Password + "");
    }

    #endregion
    
}